package cn.com.gridinfo.sooc.core.login.activity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import com.jeremy.arad.utils.AnimUtil;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
import cn.com.gridinfo.sooc.R;
import cn.com.gridinfo.sooc.base.BaseSoocActivity;
import cn.com.gridinfo.sooc.core.login.dao.RegsiterDao;

/**
 * 实名认证界面
 * @author yingchunli
 */
public class RealnameRegActivity extends BaseSoocActivity {

    @InjectView(R.id.schoolName_text)
    TextView schoolName;//学校名称
    RegsiterDao dao;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.reg_realname);
        ButterKnife.inject(this);
        dao=new RegsiterDao(this);
        //设置实名认证到哪个学校
        String str=dao.getServerName();
        Log.i("schoolName",str);
        schoolName.setText(" "+str);
    }

    @Override
    public String setupToolBarTitle() {
        return "实名认证";
    }

    @Override
    public boolean setupToolBarLeftButton(ImageView leftButton) {
        return true;
    }

    //ToolBar的back键
    @OnClick(R.id.toolbar_leftbtn)
    void onToolbarLeftClick(){

        finish();
    }

    /**
     * 我是学生的点击
     */
    @OnClick(R.id.student_lay)
    void onStudentClick(){
        //进行验证是否为本校学生
        Intent intent=new Intent(this,RegisterActivity.class);
        intent.putExtra("type", "student");
        startActivity(intent);
        AnimUtil.intentSlidIn(this);
    }

    /**
     * 我是老师的点击
     */
    @OnClick(R.id.teacher_lay)
    void onTeacherClick(){

        Intent intent=new Intent(this,RegisterActivity.class);
        intent.putExtra("type","teacher");
//        setResult(RESULT_OK, intent);
//        finish();
        startActivity(intent);
        AnimUtil.intentSlidIn(this);
    }

    /**
     * 体验账号
     */
    @OnClick(R.id.tiyan_lay)
    void onTiyanClick(){

        Intent intent=new Intent(this,RegisterActivity.class);
        intent.putExtra("type","tiyan");
//        setResult(RESULT_OK, intent);
//        finish();
        startActivity(intent);
        AnimUtil.intentSlidIn(this);
    }


}
